<extend name="Public/base" />

<block name='style'>
	<style>
		.uneditable-input, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"] {
			font-size: 12px;
			min-height: 30px;
		}

		input[type="radio"]:checked + .custom-radio:before{
			text-indent:-2px;
		}
		input[type=radio], input[type=checkbox]{margin:0px;}

		._percent{
			height: 30px;
			line-height: 30px;
			padding-left: 5px;
		}
		input.opth50{
			float:left;
			text-align:right;
		}
		.pannel_diy .col-sm-2{
			padding-left:0px;
		}
		.gowhere{
			text-align:left;
			text-indent:5px;
		}
		.pannel_diy {
			margin-top:-1px;
			margin-bottom:0px;
			padding:0px 10px;
		}
		.parsley-error-list{
			width:100%;
			float:left;
		}

		.recommend_table thead th{text-align: center;}
		.fl{float:left;}
		.fr{float: right;}
		.txt_right{text-align:right;}
		.txt_left{text-align:left;}
		.txt_center{text-align:center;}

		#weight_unit{margin-top:-7px;width:60px}
		.form-control-equal{width:50% !important;}
		.form-control-three-equal{width:30% !important;}
		.form-control-four-equal{width:25% !important;}
		.radio-inline, .checkbox-inline{padding-left:0px;}

		.page-content{padding:10px; background: #efefef;}
		.help-block{margin-bottom:0px;}
		.edit_pic_wrp_one{width: 100px !important;}
		.edit_pic_wrp_one img{
			width: 50px !important;
			height: 50px !important;
		}
		.pics_wrp .edit_pic_wrp .edit_pic_mask_one{
			width: 100%;
			height: 30px;
			background: rgba(229,229,229,0.9) !important;
			text-align: center;
			left: 0;
			bottom: 0;
			vertical-align: middle;
			line-height: 20px;
		}
		.pics_wrp .edit_pic_wrp{position:relative;}
		.ml5{margin-left:5px !important;}
		.mb5{margin-bottom:5px !important;}
		.edui-default .edui-toolbar{width:100% !important;overflow: auto !important;}

		.pics_wrp .edit_pic_wrp .edit_pic_mask{height:45px;}

		/* .form-group-validate{margin-bottom:0px !important;} */
		.Validform_checktip{width:100%;float:left;}
		.first-pic-show-table td{background-color:#fff !important;}

		#table_proccess th{height:25px;line-height: 25px;text-align:center;border-right:1px solid #ddd;}
		.pics_wrp .edit_pic_wrp .edit_pic_mask{padding-top:10px;}
		.bath{
			float: right;
			width: 100%;
			text-align: center;
			background-color: #f9f9f9;
		}
		.bath .two_tr{
			vertical-align: inherit;
		}
		.batch_full_confim_btn{
			width: 100px;
			height: 24px;
			line-height: 24px;
			text-align: center;
			font-size: 14px;
			border-radius: 2px;
			background-color: #49D861;
			border: none;
			color: #FFF;
		}
	</style>
</block>

<block name="body">
	<form action="{:U('')}" name="dataForm" id='dataForm' method="post" role="form" class="vform1 form-horizontal row-border">

		<div class="row">
			<div class="col-md-10">

				<!-- 商品名称 start -->
				<div class="block-web" id="general_info" style="padding:20px 20px 10px 20px">
					<div class="header">
						<h3 class="content-header">1、通用信息</h3>
					</div>
					<div class="form-group form-group-validate" >
						<label class="col-sm-3 control-label"><font class="red">*</font>商品中文名称</label>
						<div class="col-sm-8">
							<input type="text" value="{$goods['goods_name']}"
								   name="goods_name" id='goods_name' placeholder="" class="form-control" datatype="*" nullmsg="请输入商品名称" />
							<span class="Validform_checktip"></span>
						</div>
					</div>
					<div class="form-group form-group-validate" >
						<label class="col-sm-3 control-label"><font class="red">*</font>商品英文名称</label>
						<div class="col-sm-8">
							<input type="text" value="{$goods['goods_englishname']}"
								   name="goods_englishname" id='goods_englishname' placeholder="" class="form-control" datatype="*" nullmsg="请输入商品英文名称" />
							<span class="Validform_checktip"></span>
						</div>
					</div>
					<div class="form-group" >
						<label class="col-sm-3 control-label">商品简短标题</label>
						<div class="col-sm-8">
							<input type="text" value="{$goods['remark']}" name="remark" id='remark' placeholder="" class="form-control" />
						</div>
					</div>
					<div class="form-group form-group-validate">
						<label class="col-sm-3 control-label"><font class="red">*</font>每单最小购买量</label>
						<div class="col-sm-9">
							<input type="text" value="{$goods['minbuynumber']|default=1}"
								   name="minbuynumber" id='minbuynumber' placeholder="" class="form-control form-control-four-equal"
								   datatype="n" nullmsg="请输入每单最小购买量" errormsg="每单最小购买量必须是数字格式" />
							<span class="Validform_checktip"></span>
							<span class="help-block">提示：单笔订单商品至少购买的数量（如:单笔订单至少购买数量为1,则每单最小购买量填写1）</span>
						</div>
					</div>
					<div class="form-group form-group-validate">
						<label class="col-sm-3 control-label"><font class="red">*</font>每单最大购买量</label>
						<div class="col-sm-9">
							<input type="text" value="{$goods['maxbuynumber']|default=2}"
								   name="maxbuynumber" id='maxbuynumber' placeholder="" class="form-control form-control-four-equal"
								   datatype="n" nullmsg="请输入每单最大购买量" errormsg="每单最大购买量必须是数字格式"/>
							<span class="Validform_checktip"></span>
							<span class="help-block">提示：单笔订单商品最多能购买的数量（如:单笔订单最多能购买数量为5,则每单最大购买量填写5）</span>
						</div>
					</div>
					<div class="form-group" >
						<label class="col-sm-3 control-label"><font class="red">*</font>未发货前最多购买数量</label>
						<div class="col-sm-5">
							<input type="text" value="{$goods['maxallbuy_count']|default=0}" name="maxallbuy_count" id='maxallbuy_count' placeholder="" class="form-control form-control-equal" />
							<span class="help-block"></span>
						</div>
					</div>
					<div class="form-group" >
						<label class="col-sm-3 control-label">已售数量基数</label>
						<div class="col-sm-5">
							<input type="text" value="{$goods['sold']|default=0}" name="sold" id='sold' placeholder="" class="form-control form-control-equal" />
						</div>
					</div>

					<div class="form-group">
						<label class="col-sm-3 control-label"><font class="red">*</font>商品分类</label>
						<div class="col-sm-9">
							<select name="cat_id" id='cat_id' class="col-sm-3 control-label" datatype="*" nullmsg="请选择商品分类" >
								<option value=''>请选择商品分类</option>
								<volist name='goods_cats' id='gcats'>
									<optgroup value='{$gcats["cat_id"]}' label="{$gcats['cat_name']}">
										<volist name='gcats["childs"]' id="gcat" >
											<option value='{$gcat["cat_id"]}'>&nbsp;&nbsp;|-{$gcat['cat_name']}</option>
										</volist>
									</optgroup>
								</volist>
							</select>
							<span class="Validform_checktip"></span>
						</div>
					</div>

					<div class="form-group">
						<label class="col-sm-3 control-label"><font class="red">*</font>商品品牌</label>
						<div class="col-sm-9">
							<select name="brand_id" id='brand_id' class="col-sm-3 control-label"  datatype="*" nullmsg="请选择商品品牌">
								<option value=''>请选择商品品牌</option>
								<volist name='brand_list' id='brand'>
									<option value='{$brand["brand_id"]}'>{$brand['brand_name']}</option>
								</volist>
							</select>
							<span class="Validform_checktip"></span>
						</div>
					</div>
					<script>$('#cat_id').val({$goods['cat_id']});$('#brand_id').val({$goods['brand_id']});</script>

					<div class="form-group" style="display:none;">
						<label class="col-sm-3 control-label">商品实际库存数量</label>
						<div class="col-sm-5">
							<input type="text" name="goods_number" disabled id="goods_number" min="0" class="form-control form-control-equal"
								   value="{$goods['goods_number']|default=0}" readonly/>
							<span class="help-block">(该项已不提供修改，如需修改请联系进销存管理人员)</span>
						</div>
					</div>

					<div class="form-group" style="display:none;">
						<label class="col-sm-3 control-label">待发货库存数量</label>
						<div class="col-sm-5">
							<input type="text" name="wait_sendgoods_stock" disabled id="wait_sendgoods_stock" min="0"
								   placeholder="" class="form-control form-control-equal" value="{$goods['goods_number']|default=0}" readonly/>
						</div>
					</div>

					<div class="form-group" style="display:none;">
						<label class="col-sm-3 control-label">可售库存数量</label>
						<div class="col-sm-5">
							<input type="text" name="can_sales_num" disabled id="can_sales_num" min="0" readonly class="form-control form-control-equal"
								   value="{$goods['can_sales_num']|default=0}" />
						</div>
					</div>

					<div class="form-group">
						<label class="col-sm-3 control-label">库存警告数量</label>
						<div class="col-sm-5">
							<input type="text" name="warn_number" id="warn_number" min="0" class="form-control form-control-equal"
								   value="{$goods['warn_number']|default=1}" />
						</div>
					</div>

					<div class="form-group">
						<label class="col-sm-3 control-label">加入推荐</label>
						<div class="col-sm-9">
							<label class="checkbox-inline">
								<input type="checkbox" value="1" name="is_best" <notempty name="goods['is_best']">checked</notempty>>
								<span class="custom-checkbox"></span>精品
							</label>

							<label class="checkbox-inline">
								<input type="checkbox" value="1" name="is_new" <notempty name="goods['is_new']">checked</notempty>>
								<span class="custom-checkbox"></span>新品
							</label>

							<label class="checkbox-inline">
								<input type="checkbox" value="1" name="is_hot" <notempty name="goods['is_hot']">checked</notempty>>
								<span class="custom-checkbox"></span>热销
							</label>
						</div>
					</div>

					<div class="form-group" style="display:none;">
						<label class="col-sm-3 control-label">商品当前售价</label>
						<div class="col-sm-5">
							<input type="text" name="shop_price" id="shop_price" min="0"
								   readonly disabled class="form-control form-control-equal" value="{$goods['shop_price']|default=0.00}" />
							<span class="help-block">勾选【商品价格策略】中的商品销售模式后内容自动填充</span>
						</div>
					</div>

					<div class="form-group" style="display:none;">
						<label class="col-sm-3 control-label">当前返点系数</label>
						<div class="col-sm-5">
							<input type="text" name="goods_point" id="goods_point" min="0"
								   readonly class="form-control form-control-equal" value="{$goods['goods_point']|default=0.000}" />
							<span class="help-block">勾选【商品价格策略】中的商品销售模式后内容自动填充</span>
						</div>
					</div>

					<div class="form-group">
						<label class="col-sm-3 control-label">商品关键词</label>
						<div class="col-sm-9">
							<input type="text" name="keywords" id="keywords" class="form-control" value="{$goods['keywords']}" />
							<span class="help-block">提示：多个用空格分隔</span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">商品简单描述</label>
						<div class="col-sm-9">
							<textarea name="goods_brief" id="goods_brief" class="form-control">{$goods['goods_brief']}</textarea>
							<span class="help-block">“商品关键词”和“商品简单描述” 作为商品详情页面SEO配置，为空则默认系统SEO配置</span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">管理备注</label>
						<div class="col-sm-9">
							<textarea name="seller_note" id="seller_note" class="form-control">{$goods['seller_note']}</textarea>
							<span class="help-block">仅供后台管理自己看的信息</span>
						</div>
					</div>

				</div>
				<!-- 商品名称 end -->

				<!-- 商品关键信息 start -->
				<div class="block-web" id="goods_important_info">
					<div class="header">
						<h3 class="content-header">2、商品关键信息配置</h3>
					</div>
					<div class="porlets-content">

						<div class="form-group" style="display:none;">
							<label class="col-sm-3 control-label">商品货号</label>
							<div class="col-sm-4">
								<input type="text" name="goods_sn" id="goods_sn" disabled class="form-control" value="{$goods['goods_sn']}" readonly="readonly"/>
								<span class="help-block">该项已不提供修改</span>
								<!-- 如果您不输入商品货号，系统将自动生成一个唯一的货号。 -->
							</div>
						</div>

						<div class="form-group" style="display:none;">
							<label class="col-sm-3 control-label">条形码</label>
							<div class="col-sm-4">
								<input type="text" name="bar_code" id="bar_code" disabled class="form-control" value="{$goods['bar_code']}" readonly/>
								<span class="help-block">该项已不提供修改</span>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-3 control-label">是否上架</label>
							<div class="col-sm-5">
								<label class="checkbox-inline" >
									<input onchange="onSaleChange(this);" type="checkbox" value="1" name="is_on_sale" <notempty name="goods['is_on_sale']">checked</notempty> >
									<span class="custom-checkbox"></span>上架
								</label>
								&nbsp;&nbsp;
								<span class="help-block">打勾表示允许销售，否则不允许销售。</span>
							</div>
						</div>

						<div class="form-group" style="display:none;">
							<label class="col-sm-3 control-label">上架时间</label>
							<div class="col-sm-4">
								<input type="text" disabled name="start_time" id="start_time" class="form-control form-control-equal" nullmsg="请选择上架时间" placeholder="点击选择上架时间"  value="{:(empty($goods['start_time'])?'':date('Y-m-d H:i:s',$goods['start_time']))}" readonly />
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-3 control-label">是否为奶粉</label>
							<div class="col-sm-5">
								<label class="checkbox-inline" >
									<input type="checkbox" value="1" name="is_milk" <notempty name="goods['is_milk']">checked</notempty> >
									<span class="custom-checkbox"></span>是
								</label>
								&nbsp;&nbsp;
								<span class="help-block"> 打勾表示此商品为奶粉，否则为非奶粉。</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">是否为红酒</label>
							<div class="col-sm-5">
								<label class="checkbox-inline" >
									<input type="checkbox" value="1" name="is_red_wine" <notempty name="goods['is_red_wine']">checked</notempty> >
									<span class="custom-checkbox"></span>是
								</label>
								&nbsp;&nbsp;
								<span class="help-block">打勾表示此商品为红酒，只能单独购买。</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">是否为零食类</label>
							<div class="col-sm-5">
								<label class="checkbox-inline" >
									<input type="checkbox" value="1" name="is_food" <notempty name="goods['is_food']">checked</notempty> >
									<span class="custom-checkbox"></span>是
								</label>
								<span class="help-block">打勾表示此商品为零食，否则为非零食。</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">是否添加到新品试用</label>
							<div class="col-sm-5">
								<label class="checkbox-inline" >
									<input type="checkbox" value="1" name="is_try" <notempty name="goods['is_try']">checked</notempty> >
									<span class="custom-checkbox"></span>是
								</label>
								<span class="help-block"> 打勾表示此商品为新品试用。</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">是否参与预售</label>
							<div class="col-sm-5">
								<label class="checkbox-inline" >
									<input type="checkbox" value="1" name="is_on_pre_sale" <notempty name="goods['is_on_pre_sale']">checked</notempty> >
									<span class="custom-checkbox"></span>是
								</label>
								<span class="help-block"> 打勾表示此商品参与预售。</span>
							</div>
						</div>
						<div class="form-group" style="display:none;">
							<label class="col-sm-3 control-label">是否参与满减优惠</label>
							<div class="col-sm-5">
								<label class="checkbox-inline" >
									<input type="checkbox" value="1" name="is_join_preferential" disabled <notempty name="goods['is_join_preferential']">checked</notempty> >
									<span class="custom-checkbox"></span>是
								</label>
								<span class="help-block"> 打勾表示此商品参与满减优惠。</span>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-3 control-label">报关价</label>
							<div class="col-sm-5">
								<input type="text" value="{$goods['custom_clearance_price']}" class="form-control form-control-equal" id="custom_clearance_price" name="custom_clearance_price"  readonly disabled />
								<span class="help-block"></span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">是否代销</label>
							<div class="col-sm-5">
								<input type="text" value="{:( empty($goods['distribution'])?'否':'是' )}" class="form-control form-control-equal" name="distribution" id='distribution'  readonly disabled />
								<span class="help-block"></span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商品税率</label>
							<div class="col-sm-5">
								<input type="text" value="{$goods['taxrate']}" class="form-control form-control-equal" name="taxrate" id="taxrate"  readonly disabled />
								<span class="help-block"></span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">货架号</label>
							<div class="col-sm-5">
								<input type="text" value="{$goods['shelfnumber']}" class="form-control form-control-equal" name="shelfnumber" id="shelfnumber"  readonly disabled />
								<span class="help-block"></span>
							</div>
						</div>
					</div><!--/porlets-content-->
				</div><!--/block-web-->
				<!-- 商品关键信息 end -->

				<!-- 价格策略 start -->
				<div class="block-web" id='price_tactics'>
					<div class="header">
						<h3 class="content-header">3、商品价格策略</h3>
					</div>
					<div class="porlets-content">
						<!-- 价格策略 start-->
						<div class="first_price_div" style="display:none;">
							<div class="form-group mb0 price_tactics_div">
								<label class="col-sm-3 control-label"><font class="red">*</font>商品当前销售模式</label>
								<div class="col-sm-9">
									<!-- 正价 -->
									<div class="rdio rdio-default mt8 mr15 fl">
										<input type="radio" flag="first" name="current_price_type" checked id="radioDefault_normal" value="1" />
										<label for="radioDefault_normal">正&nbsp;&nbsp;&nbsp;价 </label>
									</div>

									<div class="form-group" style="display:none;">
										<label class="col-sm-2 control-label">返点系数</label>
										<div class="col-sm-2">
											<input type="text" name="first_goods_point" price_type='1' placeholder="请输入返点系数" class="form-control price_tactics_goods_point"
												   value="1.00" oninput="price_tactics_goods_point_input_listen(this);"
												   datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/" nullmsg="请输入返点系数" errormsg="返点系数必须是数字格式" ignore="ignore"/>
										</div>
									</div>
									&nbsp;&nbsp;
									<!-- 折扣价 -->
									<div class="rdio rdio-default mt8 mr15 fl">
										<input type="radio" flag="discount" name="current_price_type" id="radioDefault_promotions" value="2">
										<label for="radioDefault_promotions">折扣价 </label>
									</div>

									<div class="form-group" style="display:none;">
										<label class="col-sm-2 control-label">返点系数</label>
										<div class="col-sm-2">
											<input type="text" name="discount_goods_point" price_type='2' placeholder="请输入返点系数" class="form-control price_tactics_goods_point"
												   value="1.00" oninput="price_tactics_goods_point_input_listen(this);"
												   datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/" nullmsg="请输入返点系数" errormsg="返点系数必须是数字格式" ignore="ignore"/>
										</div>
									</div>
									&nbsp;&nbsp;
									<!-- 特卖价 -->
									<div class="rdio rdio-default mt8 mr15 fl">
										<input type="radio" flag="sale" name="current_price_type" id="radioDefault_deals" value="3" >
										<label for="radioDefault_deals">特卖价 </label>
									</div>

									<div class="form-group" style="display:none;">
										<label class="col-sm-2 control-label">返点系数</label>
										<div class="col-sm-2">
											<input type="text" name="sale_goods_point" price_type='3' placeholder="请输入返点系数" class="form-control price_tactics_goods_point"
												   value="0.20" oninput="price_tactics_goods_point_input_listen(this);"
												   datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/" nullmsg="请输入返点系数" errormsg="返点系数必须是数字格式" ignore="ignore"/>
										</div>
									</div>

								</div>
							</div>
						</div>

						<span class="help-block txt_center" style="text-indent:0px;display:none;">提示：勾选选择销售模式，注：若勾选特卖价，会自动把该商品设为特卖商品</span>

						<div class="porlets-content">
							<div id="create_table_div">
								<notempty name="goodsList">
									<div id="public_attribute_setting_div"  >
										<table  class="table table-striped goods_list_table table-bordered bath">
											<tr>
												<td>
													批量填充
												</td>
												<td>
													<input class="batch_full_text" id="batch_full_text_goods_weight" placeholder="邮寄重量(克)"/>
												</td>
												<td>
													<input class="batch_full_text" id="batch_full_text_retail_price" placeholder="零售价"/>
												</td>

												<td>
													<input class="batch_full_text" id="batch_full_text_shop_price" placeholder="会员价"/>
												</td>

												<td>
													<input class="batch_full_text" id="batch_full_text_vip_price" placeholder="VIP价"/>
												</td>

												<td>
													<input type="button" class="batch_full_confim_btn"  value="确定" onclick="batch_full_confim_function()"/>
												</td>
											</tr>
										</table>


									</div>
								</notempty>

								<table class="table table-striped goods_list_table table-bordered">
									<thead>
									<tr>
										<th>货号(SKU)/条形码</th>
										<th>属性规格</th>
										<th>邮寄重量(克)</th>
										<th>零售价</th>
										<th>会员价</th>
										<th>VIP价</th>
									</tr>
									</thead>

									<tbody id="attr_list_content">
									<volist name="goodsList" id="g_items">
										<tr id="g_items_{$g_items['goods_id']}">
											<td>
												<div class='goodspricesettingdiv'>
													货号： {$g_items['goods_sn']|default='-'}</div>
												<div class='goodspricesettingdiv'>
													条形码：{$g_items['bar_code']|default='-'}</div>
											</td>
											<td>
												<if condition="$g_items['is_general'] eq 1">
													<font class='red'>入口SKU<br/>没有规格商品<br/>以该配置为准</font>
												</if>
												{$g_items['attribute_text']}
											</td>
											<td>
												<div class='goodspricesettingdiv'> <input name="goods_weight{$g_items['goods_id']}" data="goods_weight" class='diyvinput'   value="{:($g_items['goods_weight']*1000)}" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/" /></div>

											</td>
											<td>
												<div class='goodspricesettingdiv'><input name="retail_price{$g_items['goods_id']}" data="retail_price" class='diyvinput'   value="{$g_items['retail_price']}" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/" /></div>
											</td>
											<td>
												<div class='goodspricesettingdiv'><input name="shop_price{$g_items['goods_id']}" data="shop_price" class='diyvinput' datatype='*' value="{$g_items['shop_price']}" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/" /></div>
											</td>
											<td>
												<div class='goodspricesettingdiv'><input name="vip_price{$g_items['goods_id']}" data="vip_price" class='diyvinput'  value="{$g_items['vip_price']}" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/" /></div>
											</td>
										</tr>
									</volist>
									<empty name="goodsList">
										<tr><td colspan="6" style="text-align: center;">无多规格数据</td></tr>
									</empty>
									</tbody>
								</table>

								<notempty name="groupList">
									<table class="table table-striped goods_list_table table-bordered">

										<thead>
										<tr>
											<th>属性规格</th>
											<th>属性图片</th>
										</tr>
										</thead>

										<tbody>
										<volist name="groupList" id="g_group">
											<tr>

												<td>
													{$g_group['attribute_value']}
												</td>
												<td>
													<div class="upload_shop_img_item mb0">
														<div class="upload_wrp">
															<div class="upload_preview" id="{$g_group['id']}">
																<notempty name="g_group['attrvalue_images_info']">
																	<!-- 图片1 -->
																	<div class="pics_wrp js_guige_images_unitymain" id="g_group_img_{$g_group['attrvalue_images_info']['id']}" >
																		<div class="edit_pic_wrp edit_pic_wrp_one">
																			<img src="/attas/orgimg/{$g_group['attrvalue_images_info']['file_name']}">
																			<div class="edit_pic_mask_one">
																				<a href="javascript:;" data_id="{$g_group['attrvalue_images_info']['id']}" class="btn btn-default btn-xs red" onclick="removeThisSelected(this);">
																					<i class="fa fa-trash-o"></i>移除
																				</a>
																				<a href="{:U( 'PublicAjax/showImge',array( 'img_url'=>urlencode($g_group['attrvalue_images_info']['file_name']) ) )}" title="查看原图" target="_blank" class="btn btn-default btn-xs">
																					<i class="fa fa-search-o"></i>查看
																				</a>
																				<input type="hidden" name="{$g_group['id']}[]" data-id="{$g_group['attrvalue_images_info']['id']}" value="{$g_group['attrvalue_images_info']['file_name']}"/>


																			</div>
																		</div>
																	</div>
																</notempty>
															</div>
															<div class="upload_box">
																<div class="upload_area">
																	<a class="create_access_primary ml5"
																	   id="js_guige_images_unitysub"
																	   title="添加文件"
																	   onclick="showChoosePics2('{:U('Attachment/uploadFiles',array('groupid'=>2,'isUploadPic'=>1,'module_name'=>'goods','element_id'=>$g_group['id'],'only_choose_one'=>'yes'))}','添加商品图片')"
																	   href="javascript:">
																		<i class="fa fa-plus"></i>
																	</a>
																	<input type="hidden" name="attribute_extends_items_id[]" value="{$g_group['id']}"/>
																</div>
															</div>
														</div>
													</div>
												</td>
											</tr>
										</volist>

										</tbody>

									</table>
								</notempty>


							</div>
						</div>
						<!-- 价格策略 end-->
						<br/>
						<!-- 商品价格图片设置 start -->
						<div class="form-group mb0 price_tactics_div">
							<label class="col-sm-3 control-label"><font class="red">*</font>商品首图</label>
							<div class="col-sm-9">
								<table class="table table-striped goods_list_table  table-bordered first-pic-show-table">
									<tr>
										<th class="txt_center" width="30%">商品首图设置</th>
										<th class="txt_center" width="30%" style="display:none;">折扣商品</th>
										<th class="txt_center" width="30%" style="display:none;">特卖商品</th>
									</tr>
									<tbody>
									<tr>
										<td>
											<div class="upload_shop_img_item mb0">
												<div class="upload_wrp">
													<div class="upload_preview" id="first_goods_img">

															<!-- 图片1 -->
															<div class="pics_wrp js_guige_images_unitymain" id="first_goods_img_{$first_img_info['id']}" >
																<div class="edit_pic_wrp edit_pic_wrp_one">
																	<!--/attas/orgimg/-->
																	<img src="/{$goods['first_goods_img']}">
																	<div class="edit_pic_mask_one">
																		<a href="javascript:;" data_id="{$first_img_info['id']}" class="btn btn-default btn-xs red" onclick="removeThisSelected(this);">
																			<i class="fa fa-trash-o"></i>移除
																		</a>
																		<a href="{:U( 'PublicAjax/showImge',array( 'img_url'=>urlencode($goods['first_goods_img']) ) )}" title="查看原图" target="_blank" class="btn btn-default btn-xs">
																			<i class="fa fa-search-o"></i>查看
																		</a>
																		<input type="hidden" name="first_goods_img[]" data-id="{$first_img_info['id']}" value="{$goods['first_goods_img']}"/>
																	</div>
																</div>
															</div>

													</div>
													<div class="upload_box">
														<div class="upload_area">
															<a class="create_access_primary ml5"
															   id="js_guige_images_unitysub"
															   title="添加文件"
															   onclick="showChoosePics2('{:U('Attachment/uploadFiles',array('groupid'=>2,'isUploadPic'=>1,'module_name'=>'goods','element_id'=>'first_goods_img','only_choose_one'=>'yes'))}','添加商品图片')"
															   href="javascript:">
																<i class="fa fa-plus"></i>
															</a>
														</div>
													</div>
												</div>
											</div>
										</td>
										<td style="display:none;" >
											<div class="upload_shop_img_item mb0">
												<div class="upload_wrp">
													<div class="upload_preview" id="discount_goods_img">
														<notempty name="discount_img_info">
															<!-- 图片1 -->
															<div class="pics_wrp js_guige_images_unitymain" id="discount_goods_img_{$discount_img_info['id']}" >
																<div class="edit_pic_wrp edit_pic_wrp_one">
																	<img src="/{$goods['discount_goods_img']}">
																	<div class="edit_pic_mask_one">
																		<a href="javascript:;" data_id="{$discount_img_info['id']}" class="btn btn-default btn-xs red" onclick="removeThisSelected(this);">
																			<i class="fa fa-trash-o"></i>移除
																		</a>
																		<a href="{:U( 'PublicAjax/showImge',array( 'img_url'=>urlencode($goods['discount_goods_img']) ) )}" title="查看原图" target="_blank" class="btn btn-default btn-xs">
																			<i class="fa fa-search-o"></i>查看
																		</a>
																		<input type="hidden" name="discount_goods_img[]" data-id="{$discount_img_info['id']}" value="{:str_replace('attas/','',$goods['discount_goods_img'])}"/>
																	</div>
																</div>
															</div>
														</notempty>
													</div>
													<div class="upload_box">
														<div class="upload_area">
															<a class="create_access_primary ml5"
															   id="js_guige_images_unitysub"
															   title="添加文件"
															   onclick="showChoosePics2('{:U('Attachment/uploadFiles',array('groupid'=>2,'isUploadPic'=>1,'module_name'=>'goods','element_id'=>'discount_goods_img','only_choose_one'=>'yes'))}','添加商品图片')"
															   href="javascript:">
																<i class="fa fa-plus"></i>
															</a>
														</div>
													</div>
												</div>

												<!-- 清除浮动 -->
												<div class="clearfix"></div>
											</div>
										</td>
										<td style="display:none;">
											<div class="upload_shop_img_item mb0">
												<div class="upload_wrp">
													<div class="upload_preview" id="sale_goods_img">
														<notempty name="sale_img_info">
															<!-- 图片1 -->
															<div class="pics_wrp js_guige_images_unitymain" id="special_sell_goods_img_{$sale_img_info['id']}" >
																<div class="edit_pic_wrp edit_pic_wrp_one">
																	<img src="/{$goods['sale_goods_img']}">
																	<div class="edit_pic_mask_one">
																		<a href="javascript:;" data_id="{$goods_pics['id']}" class="btn btn-default btn-xs red" onclick="removeThisSelected(this);">
																			<i class="fa fa-trash-o"></i>移除
																		</a>
																		<a href="{:U( 'PublicAjax/showImge',array( 'img_url'=>urlencode($goods['sale_goods_img']) ) )}" title="查看原图" target="_blank" class="btn btn-default btn-xs">
																			<i class="fa fa-search-o"></i>查看
																		</a>
																		<input type="hidden" name="sale_goods_img[]" data-id="{$sale_img_info['id']}" value="{:str_replace('attas/','',$goods['sale_goods_img'])}"/>
																	</div>
																</div>
															</div>
														</notempty>
													</div>
													<div class="upload_box">
														<div class="upload_area">
															<a class="create_access_primary ml5"
															   id="js_guige_images_unitysub"
															   title="添加文件"
															   onclick="showChoosePics2('{:U('Attachment/uploadFiles',array('groupid'=>2,'isUploadPic'=>1,'module_name'=>'goods','element_id'=>'sale_goods_img','only_choose_one'=>'yes'))}','添加商品图片');"
															   href="javascript:">
																<i class="fa fa-plus"></i>
															</a>
														</div>
													</div>
												</div>

												<!-- 清除浮动 -->
												<div class="clearfix"></div>
											</div>
										</td>
									</tr>
									</tbody>
								</table>
							</div>
						</div>
						<!-- 商品价格图片设置 end -->

					</div>
				</div>
				<!-- 价格策略 end -->

				<!-- 详细描述start -->
				<div class="block-web" id="goods_desc_info">
					<div class="header">
						<h3 class="content-header">4、详细描述</h3>
					</div>
					<div class="porlets-content">

						<div class="form-group " >
							<label class="col-sm-3 control-label">详细描述</label>
							<div class="porlets-content">

								<script type="text/plain" name="goods_desc" id="goods_desc">{$goods['goods_desc']}</script>

								<!-- 清除浮动 -->
								<div class="clearfix"></div>

							</div><!--/porlets-content-->
						</div>

					</div><!--/porlets-content-->
				</div><!--/block-web-->
				<!-- 详细描述end -->

				<!-- 商品图片配置 start -->
				<div class="block-web" id="goods_picture_setting">
					<div class="header">
						<h3 class="content-header">5、详情界面图片</h3>
					</div>
					<div class="porlets-content">
						<!-- ，"设为商品首图" 是在商品列表显示的商品图片 -->
						<div class="alert alert-info"> <strong>说明:</strong> 该项配置是设置商品详情界面的图片，"左移","右移"是排序 </div>

						<div class="upload_shop_img_item">
							<div class="upload_wrp">
								<div class="upload_preview" data-group="gallery_img_" id="gallery_img">
									<volist name='goods_pics' id='goods_pics' >
										<!-- 图片1 -->
										<div class="pics_wrp js_guige_images_unitymain" id="file_{$goods_pics['id']}" >
											<div class="edit_pic_wrp">
												<img src="/attas/orgimg/{$goods_pics['file_name']}">
												<div class="edit_pic_mask">
													<a class="btn btn-default btn-xs" href="javascript:;" data_id="{$goods_pics['id']}" onclick="goPrev(this);"><i class="fa fa-arrow-circle-left"></i>左移</a>
													<a class="btn btn-default btn-xs" href="javascript:;" data_id="{$goods_pics['id']}" onclick="goNext(this);"><i class="fa fa-arrow-circle-right"></i>右移</a>
													<a class="btn btn-default btn-xs red" href="javascript:;" data_id="{$goods_pics['id']}" onclick="removeThisSelected(this);"><i class="fa fa-trash-o"></i>移除</a>

													<div class="auto90" style="display:none;">
														<div class="rdio rdio-default mt5">
															<input type="radio" <if condition="$goods['goods_img'] eq $goods_pics['file_name'] ">checked</if>  name="is_first" id="frm_radio_{$goods_pics['id']}" value="{$goods_pics['id']}" >
															<label for="frm_radio_{$goods_pics['id']}">设为商品首图</label>
														</div>
													</div>
													<input type="hidden" name="gallery_img_pic[]" value="{$goods_pics['id']}"/>
													<input type="hidden" name="gallery_id[]" value="{$goods_pics['gallery_id']}"/>
												</div>
											</div>
										</div>
									</volist>

								</div>
								<div class="upload_box">
									<div class="upload_area">
										<a class="create_access_primary"
										   id="js_guige_images_unitysub"
										   title="添加文件"
										   onclick="showChoosePics2('{:U('Attachment/uploadFiles',array('groupid'=>2,'isUploadPic'=>1,'module_name'=>'goods','element_id'=>'gallery_img'))}','添加商品图片')"
										   href="javascript:">
											<i class="fa fa-plus"></i>
										</a>
									</div>
								</div>
							</div>

							<!-- 清除浮动 -->
							<div class="clearfix"></div>
						</div>


						<!-- 清除浮动 -->
						<div class="clearfix"></div>

					</div><!--/porlets-content-->
				</div><!--/block-web-->
				<!-- 商品图片配置 end -->

				<!-- 详情页推荐商品设置 start -->
				<div class="block-web" id="details_recommend_setting">
					<div class="header">
						<h3 class="content-header">6、详情页推荐商品设置</h3>
					</div>
					<div class="porlets-content">
						<!-- ，"设为商品首图" 是在商品列表显示的商品图片 -->
						<div class="alert alert-info"> <strong> 操作方式：</strong> 1. 点击“搜索” 加载商品信息 ; 2. 按照提示操作</div>


						<div class="form-group">
							<div class="col-sm-12">
								<select name="search_cat_id" id='search_cat_id' class="col-sm-3 control-label" style="margin-right:10px;">
									<option value=''>-所有分类-</option>
									<volist name='goods_cats' id='gcats'>
										<optgroup value='{$gcats["cat_id"]}' label="{$gcats['cat_name']}">
											<volist name='gcats["childs"]' id="gcat" >
												<option value='{$gcat["cat_id"]}'>&nbsp;&nbsp;|-{$gcat['cat_name']}</option>
											</volist>
										</optgroup>
									</volist>
								</select>
								<select name="search_brand_id" id='search_brand_id' class="col-sm-3 control-label">
									<option value=''>-所有品牌-</option>
									<volist name='brand_list' id='brand'>
										<option value='{$brand["brand_id"]}'>{$brand['brand_name']}</option>
									</volist>
								</select>
								&nbsp;
								<input type="text" name="search_keywords" id="search_keywords" class="parsley-validated"
									   value="" placeholder="输入商品名称或商品货号搜索" style="width:200px;" />
								&nbsp;
								<button class="btn btn-primary" type="button" onclick="relationRecommendSearch(sz3, 'search_cat_id','search_brand_id','search_keywords');">搜索</button>
							</div>
						</div>

						<div class="form-group">
							<div class="col-sm-12">
								<table width="100%" class="recommend_table">
									<thead>
									<tr><th style="line-height:25px">可选商品</th><th style="line-height:25px">操作</th><th style="line-height:25px">该商品详情页面获取到的推荐商品记录</th></tr>
									</thead>

									<tbody>
									<tr>
										<td width="42%">
											<select name="source_select3" size="20" style="width:100%" ondblclick="sz3.addItem(false, '{:U('add_link_goods')}', goodsId,$('input[name=is_single]:checked').val())" multiple="true">
											</select>
										</td>
										<td align="center">
											<div class="rdio rdio-default mt5 fl ml10">
												<input type="radio" name="is_double" id="single_choose" checked="checked" value="0">
												<label for="single_choose">单向关联 </label>
											</div>
											<div class="rdio rdio-default mt5 fl ml10">
												<input type="radio" name="is_double" id="multi_choose" value="1">
												<label for="multi_choose">双向关联 </label>
											</div>

											<p><input type="button" value="全部推荐" onclick="sz3.addItem(true, '{:U('add_link_goods')}', goodsId, $('input[name=is_single]:checked').val())" class="btn btn-default"></p>
											<p><input type="button" value="推荐左侧选中" onclick="sz3.addItem(false, '{:U('add_link_goods')}', goodsId, $('input[name=is_single]:checked').val())" class="btn btn-default"></p>
											<p><input type="button" value="取消右侧选中" onclick="sz3.dropItem(false, '{:U('drop_link_goods')}', goodsId, $('input[name=is_single]:checked').val())" class="btn btn-default"></p>
											<p><input type="button" value="取消全部推荐" onclick="sz3.dropItem(true, '{:U('drop_link_goods')}', goodsId, $('input[name=is_single]:checked').val())" class="btn btn-default"></p>
										</td>
										<td width="45%">
											<select name="target_select3" size="20" style="width:100%" multiple="" ondblclick="sz3.dropItem(false, '{:U('drop_link_goods')}', goodsId, $('input[name=is_single]:checked').val())">
												<volist name="link_goods_list" id="link_goods">
													<option value="{$link_goods.goods_id}">{$link_goods.goods_name}</option>
												</volist>
											</select>
										</td>
									</tr>
									</tbody>
								</table>
							</div>
						</div>

					</div><!--/porlets-content-->
				</div><!--/block-web-->
				<!-- 详情页推荐商品设置 end -->

				<div style="height:100px;"></div>

			</div>

			<div class="col-md-2">

				<div class="block-web" style="position:fixed;width:190px;text-align:center;top:10px;">
					<div class="header">
						<h3 class="content-header">操作导航</h3>
					</div>
					<!-- red -->
					<div class="porlets-content">
						<a class="btn btn-default btn-sm btn-block gowhere" href="#general_info">1、通用信息</a>
						<a class="btn btn-default btn-sm btn-block gowhere" href="#goods_important_info">2、商品关键信息设置</a>
						<a class="btn btn-default btn-sm btn-block gowhere" href="#price_tactics">3、商品价格策略</a>
						<a class="btn btn-default btn-sm btn-block gowhere" href="#goods_desc_info"  >4、详细描述</a>
						<a class="btn btn-default btn-sm btn-block gowhere " href="#goods_picture_setting">5、详情界面图片</a>
						<a class="btn btn-default btn-sm btn-block gowhere" href="#details_recommend_setting">6、详情页推荐商品设置</a>

						<button class="btn btn-sm btn-block btn-primary bt_submit" type="submit" onclick='$(".Validform_checktip").html("");'>保存</button>
					</div>
				</div>

			</div>

		</div>


		<!-- 隐藏域内容区  -->
		<input type='hidden' value="{$goods['goods_id']|default=0}" name='goods_id' id='goods_id' />

		<div class="footer" >
			<button class="btn btn-primary btn-success bt_submit" type="submit" onclick='$(".Validform_checktip").html("");'>保存</button>
			<button class="btn btn-default bt_close" type="button" onclick="art.dialog.open.api.close();" >关闭</button>
		</div>


	</form>

</block>

<block name="script">

	<!-- artdialog -->
	<include file="Public:artdialog" />
	<!-- validform -->
	<include file="Public:validform" />

	<!-- 编辑器 -->
	<script type="text/javascript" charset="utf-8" src="/Public/static/editor/ueditor.config.js?v={:C('CURRENT_FILE_VERSION')}"></script>
	<script type="text/javascript" charset="utf-8" src="/Public/static/editor/ueditor.all.min.js?v={:C('CURRENT_FILE_VERSION')}"></script>
	<script type="text/javascript" charset="utf-8" src="/Public/static/editor/lang/zh-cn/zh-cn.js?v={:C('CURRENT_FILE_VERSION')}"></script>

	<!-- 日期 -->
	<script type="text/javascript" src="/Public/static/laydate/laydate.dev.js?v={:C('CURRENT_FILE_VERSION')}" ></script>

	<!-- js -->
	<script src="/Public/static/selectzone.js?v={:C('CURRENT_FILE_VERSION')}" type="text/javascript" ></script>
	<script src="/Public/Admin/js/module/goods_attrs.js?v={:C('CURRENT_FILE_VERSION')}" ></script>

	<script>
		var goodsId = '{$goods['goods_id']|default=0}';
		var goods_item_id = '{$goods['goods_item_id']|default=0}';
		var elements = document.forms['dataForm'].elements;
		var sz3 = new SelectZone(1, elements['source_select3'], elements['target_select3']);

		$(function(){

//			setTimeout(function(){
//				$.ajax({
//					url:"{:U('loaddingAttrsList')}",
//					data:{"goods_item_id":goods_item_id},
//					dataType:'html',
//					type:"POST",
//					success:function(data){
//						$('#attr_list_content').html(data);
//					},
//					error:function(){
//
//					},
//					complete:function(){
//
//					}
//				});
//			},400);


			$('input[name=current_price_type]').change(function(){
				var flag = $(this).attr('flag');
				var price = $(this).parents('.col-sm-9').find('input[name="'+flag+'_price"]').val();
				var goods_points = $(this).parents('.col-sm-9').find('input[name="'+flag+'_goods_point"]').val();

				$('#shop_price').val(price);
				$('#goods_point').val(goods_points);
			});

			laydate({
				elem: '#start_time',
				festival: true, //显示节日
				istime: true,
				format: 'YYYY-MM-DD hh:mm:ss'
			});

			UE.getEditor('goods_desc', {
				//关闭字数统计
				wordCount: false,
				//关闭elementPath
				elementPathEnabled: false,
				//默认的编辑区域高度
				initialFrameHeight: 400,
				//启用自动保存
				enableAutoSave: false,
				//最小高度
				minFrameHeight: 400,
				initialFrameWidth:null
			}).ready(function(){
				//吃实话内容
				//this.setContent("");
			});

			var fromchk = $(".vform1").Validform({
				tiptype: 2,
				tiptype: function (msg, o, cssctl) {
					if (!o.obj.is("form")) {

						/* 先清空所有validform_tip提示内容 */
						o.obj.siblings(".Validform_checktip").html('');

						if(o.type ==2)
						{
							var parent_ele = o.obj.attr('parent_ele');
							if ( typeof parent_ele === 'undefined' ) {
								//code
								var objtip=o.obj.siblings(".Validform_checktip");
								objtip.removeClass('Validform_wrong');
							}else{
								var objtip=o.obj.parent().siblings(".Validform_checktip");
								objtip.removeClass('Validform_wrong');
							}
							objtip.html('');
						}else{
							var parent_ele = o.obj.attr('parent_ele');
							if ( typeof parent_ele === 'undefined' ) {
								//code
								var objtip=o.obj.siblings(".Validform_checktip");
							}else{
								var objtip=o.obj.parent().siblings(".Validform_checktip");
							}

							cssctl(objtip,o.type);
							objtip.text(msg);
							/*聚焦*/
							o.obj.focus();
							showvfmsg('0', msg, 1900);
						}

						// o.type ==2//验证成功
					} else
					{
						$("#submit").attr("disabled",'disabled');
						$("#submit").html("提交中...");
						$(".bt_submit").attr("disabled", 'disabled');
						$(".bt_submit").html("提交中...");
						showvfmsg("-1", '提交中，请稍后...', 999999);
					}
				},
				ajaxPost: true,
				tipSweep: true,
				callback: function (data) {
					if (data.status) {
						var parent=    art.dialog.opener;
						parent._reload_currentpage_datalist();
						setTimeout(function(){
							 art.dialog.close();
						},1200);
					} else {

					}

					$("#submit").removeAttr("disabled");
					$("#submit").html("保 存");
					$(".bt_submit").removeAttr("disabled");
					$(".bt_submit").html("提交");
					var retstatus = data.status == 1 ? "1" : "0";
					showvfmsg(retstatus, data.info, 1900);
				}

			});


		});

		//初始化数据

		/* 详情页推荐商品关联设置 */
		function relationRecommendSearch(szObject, catId, brandId, keyword)
		{
			var filters = {};//new Object;

			filters.cat_id = elements[catId].value;
			filters.brand_id = elements[brandId].value;
			filters.keyword = $.trim(elements[keyword].value);
			filters.exclude = document.forms['dataForm'].elements['goods_id'].value;

			filters_json = filters;//JSON.stringify(filters);
			szObject.loadOptions('{:U('get_goods_list')}', filters_json);
		}


		/*批量设置*/
		function batch_full_confim_function(){
			var goods_weight=$.trim($("#batch_full_text_goods_weight").val());
			var retail_price=$.trim($("#batch_full_text_retail_price").val());
			var shop_price=$.trim($("#batch_full_text_shop_price").val());
			var vip_price=$.trim($("#batch_full_text_vip_price").val());



			if(goods_weight !="" && goods_weight >0 ){
				$("input[data='goods_weight']").val(goods_weight);
			}

			if(retail_price !="" ){
				$("input[data='retail_price']").val(retail_price);
			}

			if(shop_price !="" ){
				$("input[data='shop_price']").val(shop_price);
			}

			if(vip_price !="" ){
				$("input[data='vip_price']").val(vip_price);
			}



			//清空文本
			$("#batch_full_text_goods_weight").val('');
			$("#batch_full_text_retail_price").val('');
			$("#batch_full_text_shop_price").val('');
			$("#batch_full_text_vip_price").val('');

		}


	</script>

	<include file="uploadPicDiy" />

</block>


